/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.fatecpg.TP1;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;


/**
 * @author David
 */
public class CalculadoraFinanceira extends MIDlet implements CommandListener, ItemStateListener {



    private boolean midletPaused = false;





    //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private Command exitCommand;
    private Command JurosSimplesCommand;
    private Command JurosCospostoCommand;
    private Command DescontoSimplesCommand;
    private Command DescontoCompostoCommand;
    private Command FinanciamentoSemEntradaCommand;
    private Command FinanciamentoEntradaCommand;
    private Command LimparCommand;
    private Command CalcularCommand;
    private Command CalcularCommand1;
    private Command VoltarCommand;
    private Command VoltarCommand1;
    private Command LimparCommand1;
    private Command LimparCommand2;
    private Command CalcularCommand2;
    private Command CalcularCommand3;
    private Command VoltarCommand2;
    private Command VoltarCommand3;
    private Command LimparCommand3;
    private Command VoltarCommand4;
    private Command CalcularCommand5;
    private Command CalcularCommand4;
    private Command LimparCommand4;
    private Command LimparCommand5;
    private Command VoltarCommand5;
    private Form form;
    private Form JurosSimples;
    private TextField t1textField;
    private TextField tj1textField;
    private StringItem vf1stringItem;
    private TextField vp1textField;
    private Form JurosComposto;
    private TextField vp2textField;
    private StringItem vf2stringItem;
    private TextField tj2textField;
    private TextField t2textField;
    private Form FinanciamentoComEntrada;
    private TextField Parcelas2textField;
    private TextField TaxadeJuros2textField;
    private TextField ValorFinanciado2textField;
    private TextField ValorEntradatextField;
    private StringItem ValordaParcela2stringItem;
    private Form FinanciamentoSemEntrada;
    private StringItem ValorParcela1stringItem;
    private TextField Parcelas1textField;
    private TextField TaxadeJuros1textField;
    private TextField ValorFinanciado1textField;
    private Form DescontoSimples;
    private TextField VntextField;
    private TextField TdtextField;
    private ChoiceGroup escolhachoiceGroup;
    private TextField TempotextField;
    private StringItem ResultstringItem;
    private Form DescontoComposto;
    private TextField TaxaDescontotextField;
    private TextField TemptextField;
    private TextField ValorNominaltextField;
    private ChoiceGroup opcaochoiceGroup;
    private StringItem VaPstringItem;
    //</editor-fold>//GEN-END:|fields|0|

    private double potencia(double potencia, double base){
        double resultado = base;
        for (double i = potencia; i>1 ; i--){

                resultado *= base;
                }
        return resultado;
    }
    /**
     * The HelloMIDlet constructor.
     */
    public CalculadoraFinanceira() {
    }

    //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
    //</editor-fold>//GEN-END:|methods|0|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initilizes the application.
     * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
//GEN-LINE:|0-initialize|1|0-postInitialize
        // write post-initialize user code here
    }//GEN-BEGIN:|0-initialize|2|
    //</editor-fold>//GEN-END:|0-initialize|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
        switchDisplayable(null, getForm());//GEN-LINE:|3-startMIDlet|1|3-postAction
        // write post-action user code here
    }//GEN-BEGIN:|3-startMIDlet|2|
    //</editor-fold>//GEN-END:|3-startMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
    //</editor-fold>//GEN-END:|4-resumeMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
        // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
    //</editor-fold>//GEN-END:|5-switchDisplayable|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular displayable.
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == DescontoComposto) {//GEN-BEGIN:|7-commandAction|1|59-preAction
            if (command == CalcularCommand3) {//GEN-END:|7-commandAction|1|59-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|2|59-postAction

                try{
                    double ValorNominal = Double.parseDouble(ValorNominaltextField.getString());
                    double TaxaDesconto = Double.parseDouble(TaxaDescontotextField.getString());
                    double temp = Double.parseDouble(TemptextField.getString());
                    double resultado = 0;
                    double preresult1 = 1-(TaxaDesconto/100);
                    double preresult2 = 1+(TaxaDesconto/100);


                    if(opcaochoiceGroup.isSelected(0)){
                        resultado = ValorNominal/(1/(potencia(temp, preresult1)));

                    }else if(opcaochoiceGroup.isSelected(1)){
                        resultado = ValorNominal*(1/(potencia(temp, preresult2)));
                    }
                    VaPstringItem.setText(Double.toString(resultado));


                }catch(Exception ex){

                }
            } else if (command == LimparCommand3) {//GEN-LINE:|7-commandAction|3|61-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|4|61-postAction
                ValorNominaltextField.setString("");
                TaxaDescontotextField.setString("");
                TemptextField.setString("");
                VaPstringItem.setText("");
            } else if (command == VoltarCommand3) {//GEN-LINE:|7-commandAction|5|63-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|6|63-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|7|53-preAction
        } else if (displayable == DescontoSimples) {
            if (command == CalcularCommand2) {//GEN-END:|7-commandAction|7|53-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|8|53-postAction
                try{
                    double vn = Double.parseDouble(VntextField.getString());
                    double td = Double.parseDouble(TdtextField.getString());
                    double tempo = Double.parseDouble(TempotextField.getString());
                    double result = 0;

                    if(escolhachoiceGroup.isSelected(0)){
                        result = vn*(1-((td/100)*tempo));

                    }else if(escolhachoiceGroup.isSelected(1)){
                        result = vn/(1+((td/100)*tempo));
                    }
                    ResultstringItem.setText(Double.toString(result));


                }catch(Exception ex){

                }


            } else if (command == LimparCommand2) {//GEN-LINE:|7-commandAction|9|55-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|10|55-postAction
                VntextField.setString("");
                TdtextField.setString("");
                TempotextField.setString("");
                ResultstringItem.setText("");
            } else if (command == VoltarCommand2) {//GEN-LINE:|7-commandAction|11|57-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|12|57-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|13|71-preAction
        } else if (displayable == FinanciamentoComEntrada) {
            if (command == CalcularCommand5) {//GEN-END:|7-commandAction|13|71-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|14|71-postAction
                try{
                double ValorEntrada = Double.parseDouble(ValorEntradatextField.getString());
                double ValorFinanciado2 = Double.parseDouble(ValorFinanciado2textField.getString());
                double TaxadeJuros2 = Double.parseDouble(TaxadeJuros2textField.getString());
                double Parcelas2 = Double.parseDouble(Parcelas2textField.getString());
                double auxiliar2 = 1+(TaxadeJuros2/100);
                double ValordaParcela2 = 0;


               ValordaParcela2 = (ValorFinanciado2-ValorEntrada)*((potencia(Parcelas2, auxiliar2))*(TaxadeJuros2/100))/((potencia(Parcelas2, auxiliar2))-1);





                    ValordaParcela2stringItem.setText(Double.toString(ValordaParcela2));


                }catch(Exception ex){

                }
            } else if (command == LimparCommand5) {//GEN-LINE:|7-commandAction|15|73-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|16|73-postAction
                // write post-action user code here
            } else if (command == VoltarCommand5) {//GEN-LINE:|7-commandAction|17|75-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|18|75-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|19|65-preAction
        } else if (displayable == FinanciamentoSemEntrada) {
            if (command == CalcularCommand4) {//GEN-END:|7-commandAction|19|65-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|20|65-postAction
                try{
                double ValorFinanciado1 = Double.parseDouble(ValorFinanciado1textField.getString());
                double TaxadeJuros1 = Double.parseDouble(TaxadeJuros1textField.getString());
                double Parcelas1 = Double.parseDouble(Parcelas1textField.getString());
                double auxiliar = 1+(TaxadeJuros1/100);
                double ValordaParcela = 0;


               ValordaParcela = ValorFinanciado1*((potencia(Parcelas1, auxiliar))*(TaxadeJuros1/100))/((potencia(Parcelas1, auxiliar))-1);





                    ValorParcela1stringItem.setText(Double.toString(ValordaParcela));


                }catch(Exception ex){

                }


            } else if (command == LimparCommand4) {//GEN-LINE:|7-commandAction|21|67-preAction

//GEN-LINE:|7-commandAction|22|67-postAction
                ValorFinanciado1textField.setString("");
                TaxadeJuros1textField.setString("");
                Parcelas1textField.setString("");
                ValorParcela1stringItem.setText("");
            } else if (command == VoltarCommand4) {//GEN-LINE:|7-commandAction|23|69-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|24|69-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|25|47-preAction
        } else if (displayable == JurosComposto) {
            if (command == CalcularCommand1) {//GEN-END:|7-commandAction|25|47-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|26|47-postAction

                try{
                double vp2 = Double.parseDouble(vp2textField.getString());
                double tj2 = Double.parseDouble(tj2textField.getString());
                double t2 = Integer.parseInt(t2textField.getString());
                double preresult = 1+(tj2/100);
                double vf2 =  vp2 * potencia(t2, preresult);
                vf2stringItem.setText(Double.toString(vf2));

                }catch(Exception ex){

                }




            } else if (command == LimparCommand1) {//GEN-LINE:|7-commandAction|27|49-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|28|49-postAction
                vp2textField.setString("");
                tj2textField.setString("");
                t2textField.setString("");
                vf2stringItem.setText("");
            } else if (command == VoltarCommand1) {//GEN-LINE:|7-commandAction|29|51-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|30|51-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|31|41-preAction
        } else if (displayable == JurosSimples) {
            if (command == CalcularCommand) {//GEN-END:|7-commandAction|31|41-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|32|41-postAction
                try{
                   double vp1 = Double.parseDouble(vp1textField.getString());
                   double tj1 = Double.parseDouble(tj1textField.getString());
                   double t1 = Double.parseDouble(t1textField.getString());
                   double vf1 = vp1*(1+((tj1/100)*t1));
                   vf1stringItem.setText(Double.toString(vf1));
                }catch(Exception ex){
                }
            } else if (command == LimparCommand) {//GEN-LINE:|7-commandAction|33|43-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|34|43-postAction
                vp1textField.setString("");
                tj1textField.setString("");
                t1textField.setString("");
                vf1stringItem.setText("");
            } else if (command == VoltarCommand) {//GEN-LINE:|7-commandAction|35|45-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|36|45-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|37|29-preAction
        } else if (displayable == form) {
            if (command == DescontoCompostoCommand) {//GEN-END:|7-commandAction|37|29-preAction
                // write pre-action user code here
                switchDisplayable(null, getDescontoComposto());//GEN-LINE:|7-commandAction|38|29-postAction
                // write post-action user code here
            } else if (command == DescontoSimplesCommand) {//GEN-LINE:|7-commandAction|39|27-preAction
                // write pre-action user code here
                switchDisplayable(null, getDescontoSimples());//GEN-LINE:|7-commandAction|40|27-postAction
                // write post-action user code here
            } else if (command == FinanciamentoEntradaCommand) {//GEN-LINE:|7-commandAction|41|33-preAction
                // write pre-action user code here
                switchDisplayable(null, getFinanciamentoComEntrada());//GEN-LINE:|7-commandAction|42|33-postAction
                // write post-action user code here
            } else if (command == FinanciamentoSemEntradaCommand) {//GEN-LINE:|7-commandAction|43|31-preAction
                // write pre-action user code here
                switchDisplayable(null, getFinanciamentoSemEntrada());//GEN-LINE:|7-commandAction|44|31-postAction
                // write post-action user code here
            } else if (command == JurosCospostoCommand) {//GEN-LINE:|7-commandAction|45|25-preAction
                // write pre-action user code here
                switchDisplayable(null, getJurosComposto());//GEN-LINE:|7-commandAction|46|25-postAction
                // write post-action user code here
            } else if (command == JurosSimplesCommand) {//GEN-LINE:|7-commandAction|47|23-preAction
                // write pre-action user code here
                switchDisplayable(null, getJurosSimples());//GEN-LINE:|7-commandAction|48|23-postAction
                // write post-action user code here
            } else if (command == exitCommand) {//GEN-LINE:|7-commandAction|49|19-preAction
                // write pre-action user code here
                exitMIDlet();//GEN-LINE:|7-commandAction|50|19-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|51|7-postCommandAction
        }//GEN-END:|7-commandAction|51|7-postCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|52|
    //</editor-fold>//GEN-END:|7-commandAction|52|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand ">//GEN-BEGIN:|18-getter|0|18-preInit
    /**
     * Returns an initiliazed instance of exitCommand component.
     * @return the initialized component instance
     */
    public Command getExitCommand() {
        if (exitCommand == null) {//GEN-END:|18-getter|0|18-preInit
            // write pre-init user code here
            exitCommand = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|18-getter|1|18-postInit
            // write post-init user code here
        }//GEN-BEGIN:|18-getter|2|
        return exitCommand;
    }
    //</editor-fold>//GEN-END:|18-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form ">//GEN-BEGIN:|14-getter|0|14-preInit
    /**
     * Returns an initiliazed instance of form component.
     * @return the initialized component instance
     */
    public Form getForm() {
        if (form == null) {//GEN-END:|14-getter|0|14-preInit
            // write pre-init user code here
            form = new Form("Calculadora Financeira", new Item[] { });//GEN-BEGIN:|14-getter|1|14-postInit
            form.addCommand(getExitCommand());
            form.addCommand(getJurosSimplesCommand());
            form.addCommand(getJurosCospostoCommand());
            form.addCommand(getDescontoSimplesCommand());
            form.addCommand(getDescontoCompostoCommand());
            form.addCommand(getFinanciamentoSemEntradaCommand());
            form.addCommand(getFinanciamentoEntradaCommand());
            form.setCommandListener(this);//GEN-END:|14-getter|1|14-postInit
            // write post-init user code here
        }//GEN-BEGIN:|14-getter|2|
        return form;
    }
    //</editor-fold>//GEN-END:|14-getter|2|



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: JurosSimplesCommand ">//GEN-BEGIN:|22-getter|0|22-preInit
    /**
     * Returns an initiliazed instance of JurosSimplesCommand component.
     * @return the initialized component instance
     */
    public Command getJurosSimplesCommand() {
        if (JurosSimplesCommand == null) {//GEN-END:|22-getter|0|22-preInit
            // write pre-init user code here
            JurosSimplesCommand = new Command("Juros Simples", Command.ITEM, 0);//GEN-LINE:|22-getter|1|22-postInit
            // write post-init user code here
        }//GEN-BEGIN:|22-getter|2|
        return JurosSimplesCommand;
    }
    //</editor-fold>//GEN-END:|22-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: JurosCospostoCommand ">//GEN-BEGIN:|24-getter|0|24-preInit
    /**
     * Returns an initiliazed instance of JurosCospostoCommand component.
     * @return the initialized component instance
     */
    public Command getJurosCospostoCommand() {
        if (JurosCospostoCommand == null) {//GEN-END:|24-getter|0|24-preInit
            // write pre-init user code here
            JurosCospostoCommand = new Command("Juros Composto", Command.ITEM, 0);//GEN-LINE:|24-getter|1|24-postInit
            // write post-init user code here
        }//GEN-BEGIN:|24-getter|2|
        return JurosCospostoCommand;
    }
    //</editor-fold>//GEN-END:|24-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: DescontoSimplesCommand ">//GEN-BEGIN:|26-getter|0|26-preInit
    /**
     * Returns an initiliazed instance of DescontoSimplesCommand component.
     * @return the initialized component instance
     */
    public Command getDescontoSimplesCommand() {
        if (DescontoSimplesCommand == null) {//GEN-END:|26-getter|0|26-preInit
            // write pre-init user code here
            DescontoSimplesCommand = new Command("Desconto Simples", Command.ITEM, 0);//GEN-LINE:|26-getter|1|26-postInit
            // write post-init user code here
        }//GEN-BEGIN:|26-getter|2|
        return DescontoSimplesCommand;
    }
    //</editor-fold>//GEN-END:|26-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: DescontoCompostoCommand ">//GEN-BEGIN:|28-getter|0|28-preInit
    /**
     * Returns an initiliazed instance of DescontoCompostoCommand component.
     * @return the initialized component instance
     */
    public Command getDescontoCompostoCommand() {
        if (DescontoCompostoCommand == null) {//GEN-END:|28-getter|0|28-preInit
            // write pre-init user code here
            DescontoCompostoCommand = new Command("Desconto Composto", Command.ITEM, 0);//GEN-LINE:|28-getter|1|28-postInit
            // write post-init user code here
        }//GEN-BEGIN:|28-getter|2|
        return DescontoCompostoCommand;
    }
    //</editor-fold>//GEN-END:|28-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: FinanciamentoSemEntradaCommand ">//GEN-BEGIN:|30-getter|0|30-preInit
    /**
     * Returns an initiliazed instance of FinanciamentoSemEntradaCommand component.
     * @return the initialized component instance
     */
    public Command getFinanciamentoSemEntradaCommand() {
        if (FinanciamentoSemEntradaCommand == null) {//GEN-END:|30-getter|0|30-preInit
            // write pre-init user code here
            FinanciamentoSemEntradaCommand = new Command("Financiamento sem Entrada", Command.ITEM, 0);//GEN-LINE:|30-getter|1|30-postInit
            // write post-init user code here
        }//GEN-BEGIN:|30-getter|2|
        return FinanciamentoSemEntradaCommand;
    }
    //</editor-fold>//GEN-END:|30-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: FinanciamentoEntradaCommand ">//GEN-BEGIN:|32-getter|0|32-preInit
    /**
     * Returns an initiliazed instance of FinanciamentoEntradaCommand component.
     * @return the initialized component instance
     */
    public Command getFinanciamentoEntradaCommand() {
        if (FinanciamentoEntradaCommand == null) {//GEN-END:|32-getter|0|32-preInit
            // write pre-init user code here
            FinanciamentoEntradaCommand = new Command("Financiamento com Entrada", Command.ITEM, 0);//GEN-LINE:|32-getter|1|32-postInit
            // write post-init user code here
        }//GEN-BEGIN:|32-getter|2|
        return FinanciamentoEntradaCommand;
    }
    //</editor-fold>//GEN-END:|32-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: CalcularCommand ">//GEN-BEGIN:|40-getter|0|40-preInit
    /**
     * Returns an initiliazed instance of CalcularCommand component.
     * @return the initialized component instance
     */
    public Command getCalcularCommand() {
        if (CalcularCommand == null) {//GEN-END:|40-getter|0|40-preInit
            // write pre-init user code here
            CalcularCommand = new Command("Calcular", Command.ITEM, 0);//GEN-LINE:|40-getter|1|40-postInit
            // write post-init user code here
        }//GEN-BEGIN:|40-getter|2|
        return CalcularCommand;
    }
    //</editor-fold>//GEN-END:|40-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: LimparCommand ">//GEN-BEGIN:|42-getter|0|42-preInit
    /**
     * Returns an initiliazed instance of LimparCommand component.
     * @return the initialized component instance
     */
    public Command getLimparCommand() {
        if (LimparCommand == null) {//GEN-END:|42-getter|0|42-preInit
            // write pre-init user code here
            LimparCommand = new Command("Limpar", Command.ITEM, 0);//GEN-LINE:|42-getter|1|42-postInit
            // write post-init user code here
        }//GEN-BEGIN:|42-getter|2|
        return LimparCommand;
    }
    //</editor-fold>//GEN-END:|42-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: VoltarCommand ">//GEN-BEGIN:|44-getter|0|44-preInit
    /**
     * Returns an initiliazed instance of VoltarCommand component.
     * @return the initialized component instance
     */
    public Command getVoltarCommand() {
        if (VoltarCommand == null) {//GEN-END:|44-getter|0|44-preInit
            // write pre-init user code here
            VoltarCommand = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|44-getter|1|44-postInit
            // write post-init user code here
        }//GEN-BEGIN:|44-getter|2|
        return VoltarCommand;
    }
    //</editor-fold>//GEN-END:|44-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: CalcularCommand1 ">//GEN-BEGIN:|46-getter|0|46-preInit
    /**
     * Returns an initiliazed instance of CalcularCommand1 component.
     * @return the initialized component instance
     */
    public Command getCalcularCommand1() {
        if (CalcularCommand1 == null) {//GEN-END:|46-getter|0|46-preInit
            // write pre-init user code here
            CalcularCommand1 = new Command("Calcular", Command.ITEM, 0);//GEN-LINE:|46-getter|1|46-postInit
            // write post-init user code here
        }//GEN-BEGIN:|46-getter|2|
        return CalcularCommand1;
    }
    //</editor-fold>//GEN-END:|46-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: LimparCommand1 ">//GEN-BEGIN:|48-getter|0|48-preInit
    /**
     * Returns an initiliazed instance of LimparCommand1 component.
     * @return the initialized component instance
     */
    public Command getLimparCommand1() {
        if (LimparCommand1 == null) {//GEN-END:|48-getter|0|48-preInit
            // write pre-init user code here
            LimparCommand1 = new Command("Limpar", Command.ITEM, 0);//GEN-LINE:|48-getter|1|48-postInit
            // write post-init user code here
        }//GEN-BEGIN:|48-getter|2|
        return LimparCommand1;
    }
    //</editor-fold>//GEN-END:|48-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: VoltarCommand1 ">//GEN-BEGIN:|50-getter|0|50-preInit
    /**
     * Returns an initiliazed instance of VoltarCommand1 component.
     * @return the initialized component instance
     */
    public Command getVoltarCommand1() {
        if (VoltarCommand1 == null) {//GEN-END:|50-getter|0|50-preInit
            // write pre-init user code here
            VoltarCommand1 = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|50-getter|1|50-postInit
            // write post-init user code here
        }//GEN-BEGIN:|50-getter|2|
        return VoltarCommand1;
    }
    //</editor-fold>//GEN-END:|50-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: CalcularCommand2 ">//GEN-BEGIN:|52-getter|0|52-preInit
    /**
     * Returns an initiliazed instance of CalcularCommand2 component.
     * @return the initialized component instance
     */
    public Command getCalcularCommand2() {
        if (CalcularCommand2 == null) {//GEN-END:|52-getter|0|52-preInit
            // write pre-init user code here
            CalcularCommand2 = new Command("Calcular", Command.ITEM, 0);//GEN-LINE:|52-getter|1|52-postInit
            // write post-init user code here
        }//GEN-BEGIN:|52-getter|2|
        return CalcularCommand2;
    }
    //</editor-fold>//GEN-END:|52-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: LimparCommand2 ">//GEN-BEGIN:|54-getter|0|54-preInit
    /**
     * Returns an initiliazed instance of LimparCommand2 component.
     * @return the initialized component instance
     */
    public Command getLimparCommand2() {
        if (LimparCommand2 == null) {//GEN-END:|54-getter|0|54-preInit
            // write pre-init user code here
            LimparCommand2 = new Command("Limpar", Command.ITEM, 0);//GEN-LINE:|54-getter|1|54-postInit
            // write post-init user code here
        }//GEN-BEGIN:|54-getter|2|
        return LimparCommand2;
    }
    //</editor-fold>//GEN-END:|54-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: VoltarCommand2 ">//GEN-BEGIN:|56-getter|0|56-preInit
    /**
     * Returns an initiliazed instance of VoltarCommand2 component.
     * @return the initialized component instance
     */
    public Command getVoltarCommand2() {
        if (VoltarCommand2 == null) {//GEN-END:|56-getter|0|56-preInit
            // write pre-init user code here
            VoltarCommand2 = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|56-getter|1|56-postInit
            // write post-init user code here
        }//GEN-BEGIN:|56-getter|2|
        return VoltarCommand2;
    }
    //</editor-fold>//GEN-END:|56-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: CalcularCommand3 ">//GEN-BEGIN:|58-getter|0|58-preInit
    /**
     * Returns an initiliazed instance of CalcularCommand3 component.
     * @return the initialized component instance
     */
    public Command getCalcularCommand3() {
        if (CalcularCommand3 == null) {//GEN-END:|58-getter|0|58-preInit
            // write pre-init user code here
            CalcularCommand3 = new Command("Calcular", Command.ITEM, 0);//GEN-LINE:|58-getter|1|58-postInit
            // write post-init user code here
        }//GEN-BEGIN:|58-getter|2|
        return CalcularCommand3;
    }
    //</editor-fold>//GEN-END:|58-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: LimparCommand3 ">//GEN-BEGIN:|60-getter|0|60-preInit
    /**
     * Returns an initiliazed instance of LimparCommand3 component.
     * @return the initialized component instance
     */
    public Command getLimparCommand3() {
        if (LimparCommand3 == null) {//GEN-END:|60-getter|0|60-preInit
            // write pre-init user code here
            LimparCommand3 = new Command("Limpar", Command.ITEM, 0);//GEN-LINE:|60-getter|1|60-postInit
            // write post-init user code here
        }//GEN-BEGIN:|60-getter|2|
        return LimparCommand3;
    }
    //</editor-fold>//GEN-END:|60-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: VoltarCommand3 ">//GEN-BEGIN:|62-getter|0|62-preInit
    /**
     * Returns an initiliazed instance of VoltarCommand3 component.
     * @return the initialized component instance
     */
    public Command getVoltarCommand3() {
        if (VoltarCommand3 == null) {//GEN-END:|62-getter|0|62-preInit
            // write pre-init user code here
            VoltarCommand3 = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|62-getter|1|62-postInit
            // write post-init user code here
        }//GEN-BEGIN:|62-getter|2|
        return VoltarCommand3;
    }
    //</editor-fold>//GEN-END:|62-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: CalcularCommand4 ">//GEN-BEGIN:|64-getter|0|64-preInit
    /**
     * Returns an initiliazed instance of CalcularCommand4 component.
     * @return the initialized component instance
     */
    public Command getCalcularCommand4() {
        if (CalcularCommand4 == null) {//GEN-END:|64-getter|0|64-preInit
            // write pre-init user code here
            CalcularCommand4 = new Command("Calcular", Command.ITEM, 0);//GEN-LINE:|64-getter|1|64-postInit
            // write post-init user code here
        }//GEN-BEGIN:|64-getter|2|
        return CalcularCommand4;
    }
    //</editor-fold>//GEN-END:|64-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: LimparCommand4 ">//GEN-BEGIN:|66-getter|0|66-preInit
    /**
     * Returns an initiliazed instance of LimparCommand4 component.
     * @return the initialized component instance
     */
    public Command getLimparCommand4() {
        if (LimparCommand4 == null) {//GEN-END:|66-getter|0|66-preInit
            // write pre-init user code here
            LimparCommand4 = new Command("Limpar", Command.ITEM, 0);//GEN-LINE:|66-getter|1|66-postInit
            // write post-init user code here
        }//GEN-BEGIN:|66-getter|2|
        return LimparCommand4;
    }
    //</editor-fold>//GEN-END:|66-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: VoltarCommand4 ">//GEN-BEGIN:|68-getter|0|68-preInit
    /**
     * Returns an initiliazed instance of VoltarCommand4 component.
     * @return the initialized component instance
     */
    public Command getVoltarCommand4() {
        if (VoltarCommand4 == null) {//GEN-END:|68-getter|0|68-preInit
            // write pre-init user code here
            VoltarCommand4 = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|68-getter|1|68-postInit
            // write post-init user code here
        }//GEN-BEGIN:|68-getter|2|
        return VoltarCommand4;
    }
    //</editor-fold>//GEN-END:|68-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: CalcularCommand5 ">//GEN-BEGIN:|70-getter|0|70-preInit
    /**
     * Returns an initiliazed instance of CalcularCommand5 component.
     * @return the initialized component instance
     */
    public Command getCalcularCommand5() {
        if (CalcularCommand5 == null) {//GEN-END:|70-getter|0|70-preInit
            // write pre-init user code here
            CalcularCommand5 = new Command("Calcular", Command.ITEM, 0);//GEN-LINE:|70-getter|1|70-postInit
            // write post-init user code here
        }//GEN-BEGIN:|70-getter|2|
        return CalcularCommand5;
    }
    //</editor-fold>//GEN-END:|70-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: LimparCommand5 ">//GEN-BEGIN:|72-getter|0|72-preInit
    /**
     * Returns an initiliazed instance of LimparCommand5 component.
     * @return the initialized component instance
     */
    public Command getLimparCommand5() {
        if (LimparCommand5 == null) {//GEN-END:|72-getter|0|72-preInit
            // write pre-init user code here
            LimparCommand5 = new Command("Limpar", Command.ITEM, 0);//GEN-LINE:|72-getter|1|72-postInit
            // write post-init user code here
        }//GEN-BEGIN:|72-getter|2|
        return LimparCommand5;
    }
    //</editor-fold>//GEN-END:|72-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: VoltarCommand5 ">//GEN-BEGIN:|74-getter|0|74-preInit
    /**
     * Returns an initiliazed instance of VoltarCommand5 component.
     * @return the initialized component instance
     */
    public Command getVoltarCommand5() {
        if (VoltarCommand5 == null) {//GEN-END:|74-getter|0|74-preInit
            // write pre-init user code here
            VoltarCommand5 = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|74-getter|1|74-postInit
            // write post-init user code here
        }//GEN-BEGIN:|74-getter|2|
        return VoltarCommand5;
    }
    //</editor-fold>//GEN-END:|74-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: JurosSimples ">//GEN-BEGIN:|34-getter|0|34-preInit
    /**
     * Returns an initiliazed instance of JurosSimples component.
     * @return the initialized component instance
     */
    public Form getJurosSimples() {
        if (JurosSimples == null) {//GEN-END:|34-getter|0|34-preInit
            // write pre-init user code here
            JurosSimples = new Form("Juros Simples", new Item[] { getVp1textField(), getTj1textField(), getT1textField(), getVf1stringItem() });//GEN-BEGIN:|34-getter|1|34-postInit
            JurosSimples.addCommand(getCalcularCommand());
            JurosSimples.addCommand(getLimparCommand());
            JurosSimples.addCommand(getVoltarCommand());
            JurosSimples.setCommandListener(this);//GEN-END:|34-getter|1|34-postInit
            // write post-init user code here
        }//GEN-BEGIN:|34-getter|2|
        return JurosSimples;
    }
    //</editor-fold>//GEN-END:|34-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: JurosComposto ">//GEN-BEGIN:|35-getter|0|35-preInit
    /**
     * Returns an initiliazed instance of JurosComposto component.
     * @return the initialized component instance
     */
    public Form getJurosComposto() {
        if (JurosComposto == null) {//GEN-END:|35-getter|0|35-preInit
            // write pre-init user code here
            JurosComposto = new Form("Juros Composto", new Item[] { getVp2textField(), getTj2textField(), getT2textField(), getVf2stringItem() });//GEN-BEGIN:|35-getter|1|35-postInit
            JurosComposto.addCommand(getCalcularCommand1());
            JurosComposto.addCommand(getLimparCommand1());
            JurosComposto.addCommand(getVoltarCommand1());
            JurosComposto.setCommandListener(this);//GEN-END:|35-getter|1|35-postInit
            // write post-init user code here
        }//GEN-BEGIN:|35-getter|2|
        return JurosComposto;
    }
    //</editor-fold>//GEN-END:|35-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: DescontoSimples ">//GEN-BEGIN:|36-getter|0|36-preInit
    /**
     * Returns an initiliazed instance of DescontoSimples component.
     * @return the initialized component instance
     */
    public Form getDescontoSimples() {
        if (DescontoSimples == null) {//GEN-END:|36-getter|0|36-preInit
            // write pre-init user code here
            DescontoSimples = new Form("Desconto Simples", new Item[] { getEscolhachoiceGroup(), getVntextField(), getTdtextField(), getTempotextField(), getResultstringItem() });//GEN-BEGIN:|36-getter|1|36-postInit
            DescontoSimples.addCommand(getCalcularCommand2());
            DescontoSimples.addCommand(getLimparCommand2());
            DescontoSimples.addCommand(getVoltarCommand2());
            DescontoSimples.setCommandListener(this);//GEN-END:|36-getter|1|36-postInit
            // write post-init user code here
        }//GEN-BEGIN:|36-getter|2|
        return DescontoSimples;
    }
    //</editor-fold>//GEN-END:|36-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: DescontoComposto ">//GEN-BEGIN:|37-getter|0|37-preInit
    /**
     * Returns an initiliazed instance of DescontoComposto component.
     * @return the initialized component instance
     */
    public Form getDescontoComposto() {
        if (DescontoComposto == null) {//GEN-END:|37-getter|0|37-preInit
            // write pre-init user code here
            DescontoComposto = new Form("Desconto Composto", new Item[] { getOpcaochoiceGroup(), getValorNominaltextField(), getTaxaDescontotextField(), getTemptextField(), getVaPstringItem() });//GEN-BEGIN:|37-getter|1|37-postInit
            DescontoComposto.addCommand(getCalcularCommand3());
            DescontoComposto.addCommand(getLimparCommand3());
            DescontoComposto.addCommand(getVoltarCommand3());
            DescontoComposto.setCommandListener(this);//GEN-END:|37-getter|1|37-postInit
            // write post-init user code here
        }//GEN-BEGIN:|37-getter|2|
        return DescontoComposto;
    }
    //</editor-fold>//GEN-END:|37-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: FinanciamentoComEntrada ">//GEN-BEGIN:|38-getter|0|38-preInit
    /**
     * Returns an initiliazed instance of FinanciamentoComEntrada component.
     * @return the initialized component instance
     */
    public Form getFinanciamentoComEntrada() {
        if (FinanciamentoComEntrada == null) {//GEN-END:|38-getter|0|38-preInit
            // write pre-init user code here
            FinanciamentoComEntrada = new Form("Financiamento com Entrada(Tabela Price)", new Item[] { getValorEntradatextField(), getValorFinanciado2textField(), getTaxadeJuros2textField(), getParcelas2textField(), getValordaParcela2stringItem() });//GEN-BEGIN:|38-getter|1|38-postInit
            FinanciamentoComEntrada.addCommand(getCalcularCommand5());
            FinanciamentoComEntrada.addCommand(getLimparCommand5());
            FinanciamentoComEntrada.addCommand(getVoltarCommand5());
            FinanciamentoComEntrada.setCommandListener(this);//GEN-END:|38-getter|1|38-postInit
            // write post-init user code here
        }//GEN-BEGIN:|38-getter|2|
        return FinanciamentoComEntrada;
    }
    //</editor-fold>//GEN-END:|38-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: FinanciamentoSemEntrada ">//GEN-BEGIN:|39-getter|0|39-preInit
    /**
     * Returns an initiliazed instance of FinanciamentoSemEntrada component.
     * @return the initialized component instance
     */
    public Form getFinanciamentoSemEntrada() {
        if (FinanciamentoSemEntrada == null) {//GEN-END:|39-getter|0|39-preInit
            // write pre-init user code here
            FinanciamentoSemEntrada = new Form("Financiamento sem Entrada(Tabela price)", new Item[] { getValorFinanciado1textField(), getTaxadeJuros1textField(), getParcelas1textField(), getValorParcela1stringItem() });//GEN-BEGIN:|39-getter|1|39-postInit
            FinanciamentoSemEntrada.addCommand(getCalcularCommand4());
            FinanciamentoSemEntrada.addCommand(getLimparCommand4());
            FinanciamentoSemEntrada.addCommand(getVoltarCommand4());
            FinanciamentoSemEntrada.setCommandListener(this);//GEN-END:|39-getter|1|39-postInit
            // write post-init user code here
        }//GEN-BEGIN:|39-getter|2|
        return FinanciamentoSemEntrada;
    }
    //</editor-fold>//GEN-END:|39-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: vp1textField ">//GEN-BEGIN:|91-getter|0|91-preInit
    /**
     * Returns an initiliazed instance of vp1textField component.
     * @return the initialized component instance
     */
    public TextField getVp1textField() {
        if (vp1textField == null) {//GEN-END:|91-getter|0|91-preInit
            // write pre-init user code here
            vp1textField = new TextField("Valor presente:", "", 32, TextField.DECIMAL);//GEN-LINE:|91-getter|1|91-postInit
            // write post-init user code here
        }//GEN-BEGIN:|91-getter|2|
        return vp1textField;
    }
    //</editor-fold>//GEN-END:|91-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: tj1textField ">//GEN-BEGIN:|92-getter|0|92-preInit
    /**
     * Returns an initiliazed instance of tj1textField component.
     * @return the initialized component instance
     */
    public TextField getTj1textField() {
        if (tj1textField == null) {//GEN-END:|92-getter|0|92-preInit
            // write pre-init user code here
            tj1textField = new TextField("Taxa de juros(ao mes):", "", 32, TextField.DECIMAL);//GEN-LINE:|92-getter|1|92-postInit
            // write post-init user code here
        }//GEN-BEGIN:|92-getter|2|
        return tj1textField;
    }
    //</editor-fold>//GEN-END:|92-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: t1textField ">//GEN-BEGIN:|93-getter|0|93-preInit
    /**
     * Returns an initiliazed instance of t1textField component.
     * @return the initialized component instance
     */
    public TextField getT1textField() {
        if (t1textField == null) {//GEN-END:|93-getter|0|93-preInit
            // write pre-init user code here
            t1textField = new TextField("Tempo(em meses):", "", 32, TextField.DECIMAL);//GEN-LINE:|93-getter|1|93-postInit
            // write post-init user code here
        }//GEN-BEGIN:|93-getter|2|
        return t1textField;
    }
    //</editor-fold>//GEN-END:|93-getter|2|
    //</editor-fold>
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: vf1stringItem ">//GEN-BEGIN:|94-getter|0|94-preInit
    /**
     * Returns an initiliazed instance of vf1stringItem component.
     * @return the initialized component instance
     */
    public StringItem getVf1stringItem() {
        if (vf1stringItem == null) {//GEN-END:|94-getter|0|94-preInit
            // write pre-init user code here
            vf1stringItem = new StringItem("Valor futuro:", "");//GEN-LINE:|94-getter|1|94-postInit
            // write post-init user code here
        }//GEN-BEGIN:|94-getter|2|
        return vf1stringItem;
    }
    //</editor-fold>//GEN-END:|94-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: vp2textField ">//GEN-BEGIN:|95-getter|0|95-preInit
    /**
     * Returns an initiliazed instance of vp2textField component.
     * @return the initialized component instance
     */
    public TextField getVp2textField() {
        if (vp2textField == null) {//GEN-END:|95-getter|0|95-preInit
            // write pre-init user code here
            vp2textField = new TextField("Valor presente:", "", 32, TextField.DECIMAL);//GEN-LINE:|95-getter|1|95-postInit
            // write post-init user code here
        }//GEN-BEGIN:|95-getter|2|
        return vp2textField;
    }
    //</editor-fold>//GEN-END:|95-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: tj2textField ">//GEN-BEGIN:|96-getter|0|96-preInit
    /**
     * Returns an initiliazed instance of tj2textField component.
     * @return the initialized component instance
     */
    public TextField getTj2textField() {
        if (tj2textField == null) {//GEN-END:|96-getter|0|96-preInit
            // write pre-init user code here
            tj2textField = new TextField("Taxa de juros(ao mes):", "", 32, TextField.DECIMAL);//GEN-LINE:|96-getter|1|96-postInit
            // write post-init user code here
        }//GEN-BEGIN:|96-getter|2|
        return tj2textField;
    }
    //</editor-fold>//GEN-END:|96-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: t2textField ">//GEN-BEGIN:|97-getter|0|97-preInit
    /**
     * Returns an initiliazed instance of t2textField component.
     * @return the initialized component instance
     */
    public TextField getT2textField() {
        if (t2textField == null) {//GEN-END:|97-getter|0|97-preInit
            // write pre-init user code here
            t2textField = new TextField("Tempo(em meses):", "", 32, TextField.DECIMAL);//GEN-LINE:|97-getter|1|97-postInit
            // write post-init user code here
        }//GEN-BEGIN:|97-getter|2|
        return t2textField;
    }
    //</editor-fold>//GEN-END:|97-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: vf2stringItem ">//GEN-BEGIN:|98-getter|0|98-preInit
    /**
     * Returns an initiliazed instance of vf2stringItem component.
     * @return the initialized component instance
     */
    public StringItem getVf2stringItem() {
        if (vf2stringItem == null) {//GEN-END:|98-getter|0|98-preInit
            // write pre-init user code here
            vf2stringItem = new StringItem("Valor futuro:", "");//GEN-LINE:|98-getter|1|98-postInit
            // write post-init user code here
        }//GEN-BEGIN:|98-getter|2|
        return vf2stringItem;
    }
    //</editor-fold>//GEN-END:|98-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: escolhachoiceGroup ">//GEN-BEGIN:|99-getter|0|99-preInit
    /**
     * Returns an initiliazed instance of escolhachoiceGroup component.
     * @return the initialized component instance
     */
    public ChoiceGroup getEscolhachoiceGroup() {
        if (escolhachoiceGroup == null) {//GEN-END:|99-getter|0|99-preInit
            // write pre-init user code here
            escolhachoiceGroup = new ChoiceGroup("Tipo de Desconto", Choice.EXCLUSIVE);//GEN-BEGIN:|99-getter|1|99-postInit
            escolhachoiceGroup.append("Comercial", null);
            escolhachoiceGroup.append("Racional", null);
            escolhachoiceGroup.setSelectedFlags(new boolean[] { false, false });//GEN-END:|99-getter|1|99-postInit
            // write post-init user code here
        }//GEN-BEGIN:|99-getter|2|
        return escolhachoiceGroup;
    }
    //</editor-fold>//GEN-END:|99-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: VntextField ">//GEN-BEGIN:|102-getter|0|102-preInit
    /**
     * Returns an initiliazed instance of VntextField component.
     * @return the initialized component instance
     */
    public TextField getVntextField() {
        if (VntextField == null) {//GEN-END:|102-getter|0|102-preInit
            // write pre-init user code here
            VntextField = new TextField("Valor nominal:", "", 32, TextField.DECIMAL);//GEN-LINE:|102-getter|1|102-postInit
            // write post-init user code here
        }//GEN-BEGIN:|102-getter|2|
        return VntextField;
    }
    //</editor-fold>//GEN-END:|102-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: TdtextField ">//GEN-BEGIN:|103-getter|0|103-preInit
    /**
     * Returns an initiliazed instance of TdtextField component.
     * @return the initialized component instance
     */
    public TextField getTdtextField() {
        if (TdtextField == null) {//GEN-END:|103-getter|0|103-preInit
            // write pre-init user code here
            TdtextField = new TextField("Taxa de desconto(ao mes):", "", 32, TextField.DECIMAL);//GEN-LINE:|103-getter|1|103-postInit
            // write post-init user code here
        }//GEN-BEGIN:|103-getter|2|
        return TdtextField;
    }
    //</editor-fold>//GEN-END:|103-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: TempotextField ">//GEN-BEGIN:|104-getter|0|104-preInit
    /**
     * Returns an initiliazed instance of TempotextField component.
     * @return the initialized component instance
     */
    public TextField getTempotextField() {
        if (TempotextField == null) {//GEN-END:|104-getter|0|104-preInit
            // write pre-init user code here
            TempotextField = new TextField("Tempo(em meses):", "", 32, TextField.NUMERIC);//GEN-LINE:|104-getter|1|104-postInit
            // write post-init user code here
        }//GEN-BEGIN:|104-getter|2|
        return TempotextField;
    }
    //</editor-fold>//GEN-END:|104-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ResultstringItem ">//GEN-BEGIN:|105-getter|0|105-preInit
    /**
     * Returns an initiliazed instance of ResultstringItem component.
     * @return the initialized component instance
     */
    public StringItem getResultstringItem() {
        if (ResultstringItem == null) {//GEN-END:|105-getter|0|105-preInit
            // write pre-init user code here
            ResultstringItem = new StringItem("Valor ap\u00F3s desconto:", "");//GEN-LINE:|105-getter|1|105-postInit
            // write post-init user code here
        }//GEN-BEGIN:|105-getter|2|
        return ResultstringItem;
    }
    //</editor-fold>//GEN-END:|105-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: opcaochoiceGroup ">//GEN-BEGIN:|106-getter|0|106-preInit
    /**
     * Returns an initiliazed instance of opcaochoiceGroup component.
     * @return the initialized component instance
     */
    public ChoiceGroup getOpcaochoiceGroup() {
        if (opcaochoiceGroup == null) {//GEN-END:|106-getter|0|106-preInit
            // write pre-init user code here
            opcaochoiceGroup = new ChoiceGroup("Tipo de Desconto:", Choice.EXCLUSIVE);//GEN-BEGIN:|106-getter|1|106-postInit
            opcaochoiceGroup.append("Comercial", null);
            opcaochoiceGroup.append("Racional", null);
            opcaochoiceGroup.setSelectedFlags(new boolean[] { false, false });//GEN-END:|106-getter|1|106-postInit
            // write post-init user code here
        }//GEN-BEGIN:|106-getter|2|
        return opcaochoiceGroup;
    }
    //</editor-fold>//GEN-END:|106-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ValorNominaltextField ">//GEN-BEGIN:|109-getter|0|109-preInit
    /**
     * Returns an initiliazed instance of ValorNominaltextField component.
     * @return the initialized component instance
     */
    public TextField getValorNominaltextField() {
        if (ValorNominaltextField == null) {//GEN-END:|109-getter|0|109-preInit
            // write pre-init user code here
            ValorNominaltextField = new TextField("Valor nominal:", "", 32, TextField.DECIMAL);//GEN-LINE:|109-getter|1|109-postInit
            // write post-init user code here
        }//GEN-BEGIN:|109-getter|2|
        return ValorNominaltextField;
    }
    //</editor-fold>//GEN-END:|109-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: TaxaDescontotextField ">//GEN-BEGIN:|110-getter|0|110-preInit
    /**
     * Returns an initiliazed instance of TaxaDescontotextField component.
     * @return the initialized component instance
     */
    public TextField getTaxaDescontotextField() {
        if (TaxaDescontotextField == null) {//GEN-END:|110-getter|0|110-preInit
            // write pre-init user code here
            TaxaDescontotextField = new TextField("Taxa de desconto(ao mes):", "", 32, TextField.DECIMAL);//GEN-LINE:|110-getter|1|110-postInit
            // write post-init user code here
        }//GEN-BEGIN:|110-getter|2|
        return TaxaDescontotextField;
    }
    //</editor-fold>//GEN-END:|110-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: TemptextField ">//GEN-BEGIN:|111-getter|0|111-preInit
    /**
     * Returns an initiliazed instance of TemptextField component.
     * @return the initialized component instance
     */
    public TextField getTemptextField() {
        if (TemptextField == null) {//GEN-END:|111-getter|0|111-preInit
            // write pre-init user code here
            TemptextField = new TextField("Tempo(em meses):", "", 32, TextField.NUMERIC);//GEN-LINE:|111-getter|1|111-postInit
            // write post-init user code here
        }//GEN-BEGIN:|111-getter|2|
        return TemptextField;
    }
    //</editor-fold>//GEN-END:|111-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: VaPstringItem ">//GEN-BEGIN:|112-getter|0|112-preInit
    /**
     * Returns an initiliazed instance of VaPstringItem component.
     * @return the initialized component instance
     */
    public StringItem getVaPstringItem() {
        if (VaPstringItem == null) {//GEN-END:|112-getter|0|112-preInit
            // write pre-init user code here
            VaPstringItem = new StringItem("Valor ap\u00F3s desconto:", "");//GEN-LINE:|112-getter|1|112-postInit
            // write post-init user code here
        }//GEN-BEGIN:|112-getter|2|
        return VaPstringItem;
    }
    //</editor-fold>//GEN-END:|112-getter|2|
    //</editor-fold>



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ValorEntradatextField ">//GEN-BEGIN:|116-getter|0|116-preInit
    /**
     * Returns an initiliazed instance of ValorEntradatextField component.
     * @return the initialized component instance
     */
    public TextField getValorEntradatextField() {
        if (ValorEntradatextField == null) {//GEN-END:|116-getter|0|116-preInit
            // write pre-init user code here
            ValorEntradatextField = new TextField("Entrada:", "", 32, TextField.DECIMAL);//GEN-LINE:|116-getter|1|116-postInit
            // write post-init user code here
        }//GEN-BEGIN:|116-getter|2|
        return ValorEntradatextField;
    }
    //</editor-fold>//GEN-END:|116-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ValorFinanciado2textField ">//GEN-BEGIN:|117-getter|0|117-preInit
    /**
     * Returns an initiliazed instance of ValorFinanciado2textField component.
     * @return the initialized component instance
     */
    public TextField getValorFinanciado2textField() {
        if (ValorFinanciado2textField == null) {//GEN-END:|117-getter|0|117-preInit
            // write pre-init user code here
            ValorFinanciado2textField = new TextField("Valor financiado:", "", 32, TextField.DECIMAL);//GEN-LINE:|117-getter|1|117-postInit
            // write post-init user code here
        }//GEN-BEGIN:|117-getter|2|
        return ValorFinanciado2textField;
    }
    //</editor-fold>//GEN-END:|117-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: TaxadeJuros2textField ">//GEN-BEGIN:|118-getter|0|118-preInit
    /**
     * Returns an initiliazed instance of TaxadeJuros2textField component.
     * @return the initialized component instance
     */
    public TextField getTaxadeJuros2textField() {
        if (TaxadeJuros2textField == null) {//GEN-END:|118-getter|0|118-preInit
            // write pre-init user code here
            TaxadeJuros2textField = new TextField("Taxa de juros(ao mes):", "", 32, TextField.DECIMAL);//GEN-LINE:|118-getter|1|118-postInit
            // write post-init user code here
        }//GEN-BEGIN:|118-getter|2|
        return TaxadeJuros2textField;
    }
    //</editor-fold>//GEN-END:|118-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Parcelas2textField ">//GEN-BEGIN:|119-getter|0|119-preInit
    /**
     * Returns an initiliazed instance of Parcelas2textField component.
     * @return the initialized component instance
     */
    public TextField getParcelas2textField() {
        if (Parcelas2textField == null) {//GEN-END:|119-getter|0|119-preInit
            // write pre-init user code here
            Parcelas2textField = new TextField("Parcelas:", "", 32, TextField.DECIMAL);//GEN-LINE:|119-getter|1|119-postInit
            // write post-init user code here
        }//GEN-BEGIN:|119-getter|2|
        return Parcelas2textField;
    }
    //</editor-fold>//GEN-END:|119-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ValordaParcela2stringItem ">//GEN-BEGIN:|120-getter|0|120-preInit
    /**
     * Returns an initiliazed instance of ValordaParcela2stringItem component.
     * @return the initialized component instance
     */
    public StringItem getValordaParcela2stringItem() {
        if (ValordaParcela2stringItem == null) {//GEN-END:|120-getter|0|120-preInit
            // write pre-init user code here
            ValordaParcela2stringItem = new StringItem("Valor da parcela:", "");//GEN-LINE:|120-getter|1|120-postInit
            // write post-init user code here
        }//GEN-BEGIN:|120-getter|2|
        return ValordaParcela2stringItem;
    }
    //</editor-fold>//GEN-END:|120-getter|2|
    //</editor-fold>


    //</editor-fold>
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ValorFinanciado1textField ">//GEN-BEGIN:|124-getter|0|124-preInit
    /**
     * Returns an initiliazed instance of ValorFinanciado1textField component.
     * @return the initialized component instance
     */
    public TextField getValorFinanciado1textField() {
        if (ValorFinanciado1textField == null) {//GEN-END:|124-getter|0|124-preInit
            // write pre-init user code here
            ValorFinanciado1textField = new TextField("Valor Financiado:", "", 32, TextField.DECIMAL);//GEN-LINE:|124-getter|1|124-postInit
            // write post-init user code here
        }//GEN-BEGIN:|124-getter|2|
        return ValorFinanciado1textField;
    }
    //</editor-fold>//GEN-END:|124-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: TaxadeJuros1textField ">//GEN-BEGIN:|125-getter|0|125-preInit
    /**
     * Returns an initiliazed instance of TaxadeJuros1textField component.
     * @return the initialized component instance
     */
    public TextField getTaxadeJuros1textField() {
        if (TaxadeJuros1textField == null) {//GEN-END:|125-getter|0|125-preInit
            // write pre-init user code here
            TaxadeJuros1textField = new TextField("Taxa de juros(ao mes):", "", 32, TextField.DECIMAL);//GEN-LINE:|125-getter|1|125-postInit
            // write post-init user code here
        }//GEN-BEGIN:|125-getter|2|
        return TaxadeJuros1textField;
    }
    //</editor-fold>//GEN-END:|125-getter|2|
    //</editor-fold>
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Parcelas1textField ">//GEN-BEGIN:|126-getter|0|126-preInit
    /**
     * Returns an initiliazed instance of Parcelas1textField component.
     * @return the initialized component instance
     */
    public TextField getParcelas1textField() {
        if (Parcelas1textField == null) {//GEN-END:|126-getter|0|126-preInit
            // write pre-init user code here
            Parcelas1textField = new TextField("Parcelas:", "", 32, TextField.NUMERIC);//GEN-LINE:|126-getter|1|126-postInit
            // write post-init user code here
        }//GEN-BEGIN:|126-getter|2|
        return Parcelas1textField;
    }
    //</editor-fold>//GEN-END:|126-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ValorParcela1stringItem ">//GEN-BEGIN:|127-getter|0|127-preInit
    /**
     * Returns an initiliazed instance of ValorParcela1stringItem component.
     * @return the initialized component instance
     */
    public StringItem getValorParcela1stringItem() {
        if (ValorParcela1stringItem == null) {//GEN-END:|127-getter|0|127-preInit
            // write pre-init user code here
            ValorParcela1stringItem = new StringItem("Valor da parcela:", "");//GEN-LINE:|127-getter|1|127-postInit
            // write post-init user code here
        }//GEN-BEGIN:|127-getter|2|
        return ValorParcela1stringItem;
    }
    //</editor-fold>//GEN-END:|127-getter|2|










    /**
     * Returns a display instance.
     * @return the display instance.
     */
    public Display getDisplay () {
        return Display.getDisplay(this);
    }

    /**
     * Exits MIDlet.
     */
    public void exitMIDlet() {
        switchDisplayable (null, null);
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Called when MIDlet is started.
     * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
     */
    public void startApp() {
        if (midletPaused) {
            resumeMIDlet ();
        } else {
            initialize ();
            startMIDlet ();
        }
        midletPaused = false;
    }

    /**
     * Called when MIDlet is paused.
     */
    public void pauseApp() {
        midletPaused = true;
    }

    /**
     * Called to signal the MIDlet to terminate.
     * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
     */
    public void destroyApp(boolean unconditional) {
    }

    public void itemStateChanged(Item item) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
